/**
 * Created by LiuLuKang on 2017/9/22.
 */
 //顶部li的hover效果：
$(".below li").mouseover(function(){
	$(this).css("color","#339966");
}).mouseout(function(){
	$(this).css("color","black");
});

//第一个轮播：
var count=0;
$(".banner .leftBtn").click(function(){
	count++;
	if(count==3){
		count=0;
	}
	console.log(count);
	$(".bannerImgBox").css("opacity","0").eq(count).css("opacity","1");
});
$(".banner .rightBtn").click(function(){
	count--;
	if(count==-1){
		count=2;
	}
	console.log(count);
	$(".bannerImgBox").css("opacity","0").eq(count).css("opacity","1");
});

$(".productItem").mouseover(function(){
	$(this).children(".productItemImg").css({"transition":"all 1s","top":"-240px","left":"365px"});
}).mouseout(function(){
	$(".productItemImg").css({"top":"0","left":"0"});
});

//第二个轮播：
$(".servicesItemImg").click(function(){
	var countImg= $(this).attr("data-index");
	$(".slide").css({"display":"block"});
	var n=countImg*800;
	console.log(n);
	$(".slideBody").css({"left":-n+"px"});
	console.log($(".slideBody").css("left"));
$(".header,.show,.product,.case,.services").css({"display":"none"});
});
$(".slide .leftBtn").click(function(){
	var left=parseInt($(".slideBody").css("left"));
	$(".slideBody").css({"left":"-=800px"});
	if (left<=-2400){
		$(".slideBody").css({"left":"0"});
	}
});
$(".slide .rightBtn").click(function(){
	var left=parseInt($(".slideBody").css("left"));
	$(".slideBody").css({"left":"+=800px"});
	if (left>=0){
		$(".slideBody").css({"left":"-2400px"});
	}
});
$(".closeBtn").click(function(){
	$(".slide").css("display","none");
	$(".header,.show,.product,.case,.services").css({"display":"block"});
});